# Contributor: Gennady Feldman <gena01@gmail.com>
# Maintainer: Gennady Feldman <gena01@gmail.com>
pkgname=cassandra-cpp-driver
_pkgname=cpp-driver
pkgver=2.15.2
pkgrel=0
pkgdesc="Cassandra CPP Driver"
url="https://datastax.github.io/cpp-driver/"
arch="aarch64 x86_64 x86 ppc64le"
license="Apache-2.0"
options="!check"  # FIXME: cassandra_integration_tests won't link
makedepends="cmake make openssl-dev libuv-dev zlib-dev"
subpackages="$pkgname-dev"
source="$_pkgname-$pkgver.tar.gz::https://github.com/datastax/cpp-driver/archive/$pkgver.tar.gz
	"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	mkdir -p "$builddir"/build
	cd "$builddir"/build
	export CXXFLAGS="$CXXFLAGS -Wno-error=deprecated-copy"
	cmake \
		-DCMAKE_BUILD_TYPE=None \
		-DCASS_BUILD_STATIC=ON \
		-DCMAKE_INSTALL_PREFIX:PATH=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib ..
	make
}

package() {
	cd "$builddir"/build
	make DESTDIR="$pkgdir" install
}

sha512sums="f35fb7369cfd39fa0c7aed8b4fc6b926d769ef8a5f63af99fd1c8b782efb57e3a6d44378363393f45676a767066b9b967e4fbbc55df16fa5790e56fa6749ba4d  cpp-driver-2.15.2.tar.gz"
